package org.oncase.smcase.controller;

import java.io.Serializable;
import java.util.List;

import org.oncase.smcase.dao.HibernateDAO;


public class BSCControllerImpl<T> implements BSCController<T> {
	
	private HibernateDAO<T> dao;
	
	public BSCControllerImpl(HibernateDAO<T> dao) {
		this.dao = dao;
	}

	/* (non-Javadoc)
	 * @see org.oncase.smcase.controller.BSCController#findByPK(java.io.Serializable)
	 */
	public T findByPK(Serializable pk) {
		return getDAO().findByPK(pk);
	}
	
	/* (non-Javadoc)
	 * @see org.oncase.smcase.controller.BSCController#insert(T)
	 */
	public void insert(T object) {
		getDAO().insert(object);
	}
	
	/* (non-Javadoc)
	 * @see org.oncase.smcase.controller.BSCController#update(T)
	 */
	public void update(T object) {
		getDAO().update(object);
	}
	
	/* (non-Javadoc)
	 * @see org.oncase.smcase.controller.BSCController#delete(T)
	 */
	public void delete(T object){
		getDAO().delete(object);
	}
	
	/* (non-Javadoc)
	 * @see org.oncase.smcase.controller.BSCController#list()
	 */
	public List<T> list() {
		return getDAO().list();
	}
	
	protected HibernateDAO<T> getDAO() {
		return this.dao;
	}
	
}
